package com.example.app_mqttclient.sqlite;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

import androidx.annotation.Nullable;

public class MyDBOpenHelper extends SQLiteOpenHelper {
    public MyDBOpenHelper(@Nullable Context context, @Nullable String name, @Nullable SQLiteDatabase.CursorFactory factory, int version) {
        super(context, name, factory, version);
    }

    @Override
    public void onCreate(SQLiteDatabase sqLiteDatabase) {
        // 创建数据库表
        sqLiteDatabase.execSQL("CREATE TABLE ASMQTTCLIENT(" +
                "AS_ID INTEGER PRIMARY KEY AUTOINCREMENT," +
                "IMG_NUM INT," +
                "DEV_NAME TEXT," +
                "PUB_TOPIC TEXT," +
                "SUB_TOPIC TEXT)");
    }

    @Override
    public void onUpgrade(SQLiteDatabase sqLiteDatabase, int i, int i1) {

    }

}
